package com.example.demo.poc.example;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.util.ArrayList;
import java.util.List;

public class AviatorTest {

    public static void main(String[] args) {
        ScriptEngineManager manager = new ScriptEngineManager();
        ScriptEngine engine = manager.getEngineByName("AviatorScript");
        engine.put("productId","SZHWSS");
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(11);
        list.add(2);
        list.add(15);

        engine.put("list",list);
        try {
            System.out.println(engine.eval("productId"));
//            System.out.println(engine.eval("seq.max(list)"));
//            System.out.println(engine.eval("productId+'_ENTITY_INFO'"));
        } catch (ScriptException e) {
            e.printStackTrace();
        }
    }
}
